<?php

use Illuminate\Routing\Router;

Admin::registerAuthRoutes();

Route::group([
    'prefix'        => config('admin.route.prefix'),
    'namespace'     => config('admin.route.namespace'),
    'middleware'    => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/', 'HomeController@index');
	//新闻相关
    $router->any('/column/play_class_build', 'ColumnController@play_class_build');
    $router->resource('/column', 'ColumnController');
    $router->resource('/collectnews', 'CollectnewsController');
    $router->post('/news/build', 'NewsController@build');
	$router->post('/expert/build', 'NewsController@build');
    $router->post('/news/keyword', 'NewsController@keyword');
    $router->any('/news/api/tags', 'NewsController@tags');
    $router->any('/news/play_news_build', 'NewsController@play_news_build');
    $router->resource('/news', 'NewsController');
    $router->resource('/expert', 'ExpertController');
    $router->post('/delete_atlas_item', 'AtlaController@delete_atlas_item');
    $router->any('/atla/search', 'AtlaController@search');
    
    $router->resource('/atla', 'AtlaController');
    $router->resource('/video', 'VideoController');
	//单页面管理
	$router->post('/page/build_page', 'PageController@build_page');
	$router->resource('/page', 'PageController');
	//公共部分
    $router->post('/template/logs', 'TemplateController@logs');
    $router->resource('/template', 'TemplateController');
    $router->resource('/position', 'PositionController');
    $router->get('/area/api', 'AreaController@api');
    $router->post('/area/post', 'AreaController@post');
	//自定义模板管理
	$router->get('media', 'MediaController@index')->name('media-index');
    $router->get('media/download', 'MediaController@download')->name('media-download');
    $router->delete('media/delete', 'MediaController@delete')->name('media-delete');
    $router->put('media/move', 'MediaController@move')->name('media-move');
    $router->post('media/upload', 'MediaController@upload')->name('media-upload');
    $router->post('media/folder', 'MediaController@newFolder')->name('media-new-folder');
    $router->post('media/file', 'MediaController@newFile')->name('media-new-file');
    $router->post('media/info', 'MediaController@info')->name('media-info');
	// $router->post('/positionlist/select_news', 'PositionListController@select_news');
	$router->post('/positionlist/ding', 'PositionListController@ding');
    $router->resource('/positionlist', 'PositionListController');
    $router->post('home/build_index', 'HomeController@build_index');
	$router->post('home/build_common', 'HomeController@build_common');
	$router->post('home/skin', 'HomeController@skin');
	$router->post('site/build', 'SiteController@build');
	$router->resource('/site', 'SiteController');
	

    //用户管理
    $router->any('user/api', 'UserController@api');
    $router->resource('/user', 'UserController');
	
	
    
    
    
    $router->resource('/link', 'LinkController');
    
    //上传图片
    $router->post('upload/uploadImg', 'UploadController@postUploadImg');
    $router->resources([
        'china/province'        => China\ProvinceController::class,
        'china/city'            => China\CityController::class,
        'china/district'        => China\DistrictController::class
    ]);

});
